﻿using System;
using System.Collections.ObjectModel;
using Acme.Common.Infrastructure;

namespace Acme.Entities
{

    [Serializable]
    public class Event : ObservableObject
    {

        String _title = String.Empty;
        DateTime _eventDate;
        String _location = String.Empty;
        String _notes = String.Empty;
        ObservableCollection<Expense> _expenses;
        readonly Guid _id;

        public Guid Id
        {
            get { return _id; }
        }

        public ObservableCollection<Expense> Expenses
        {
            get { return _expenses; }
            set
            {
                _expenses = value;
                RaisePropertyChanged("Expenses");
            }
        }

        public String Notes
        {
            get { return _notes; }
            set
            {
                _notes = value;
                RaisePropertyChanged("Notes");
            }
        }

        public String Location
        {
            get { return _location; }
            set
            {
                _location = value;
                RaisePropertyChanged("Location");
            }
        }

        public DateTime EventDate
        {
            get { return _eventDate; }
            set
            {
                _eventDate = value;
                RaisePropertyChanged("EventDate");
            }
        }

        public String Title
        {
            get { return _title; }
            set
            {
                _title = value;
                RaisePropertyChanged("Title");
            }
        }

        public Event()
        {
            _id = Guid.NewGuid();
            _eventDate = DateTime.Today;
            _expenses = new ObservableCollection<Expense>();
        }
    }
}
